package com.caissa.springboot.starter.permission.enums;

/**
 * 审计日志的操作类型
 *
 * @Author：zhangqiang
 * @Date 2021/8/11 13:34
 */

public enum AuditLogOperateTypeEnum {
    ADD("1", "新增"),
    UPDATE("2", "修改"),
    DELETE("3", "删除"),
    QUERY("4", "查询"),
    UPLOAD("5", "上传"),
    DOWN("6", "下载"),
    ;
    /**
     * 错误码
     */
    private String code;
    /**
     * 错误描述
     */
    private String desc;

    AuditLogOperateTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getDescByCode(String code){
        for (AuditLogOperateTypeEnum value : values()) {
            if(value.code.equals(code)){
                return value.getDesc();
            }
        }
        return null;
    }

    public String getCode() {
        return this.code;

    }

    public String getDesc() {
        return this.desc;

    }
}
